/* SPI Master example

   This example code is in the Public Domain (or CC0 licensed, at your option.)

   Unless required by applicable law or agreed to in writing, this
   software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
   CONDITIONS OF ANY KIND, either express or implied.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "esp_system.h"
#include "driver/spi_master.h"
#include "lcd_spi.h"

/*
 This code displays some fancy graphics on the 320x240 LCD on an ESP-WROVER_KIT board.
 This example demonstrates the use of both spi_device_transmit as well as
 spi_device_queue_trans/spi_device_get_trans_result and pre-transmit callbacks.

 Some info about the ILI9341/ST7789V: It has an C/D line, which is connected to a GPIO here. It expects this
 line to be low for a command and high for data. We use a pre-transmit callback here to control that
 line: every transaction has as the user-definable argument the needed state of the D/C line and just
 before the transaction is sent, the callback will set this line to the correct state.
*/

void vTask1(void *pvParameters);
void lvgl_template_init();
void app_main(void)
{
    spi_lcd_init();
   // LCD_Fill(0, 0, 320, 240, DARKBLUE);
    xTaskCreate(vTask1,"vtask1",4096,NULL,5,NULL);
}


void vTask1(void *pvParameters)
{

    while(1)
    {
        printf("hello\n");
        vTaskDelay(10);
    }
}

// void lvgl_template_init()
// {

//     lv_disp_drv_t disp_drv;                         /*Descriptor of a display driver*/
//    lv_disp_drv_init(&disp_drv);                    /*Basic initialization*/

//    /*Set up the functions to access to your display*/
//    disp_drv.disp_flush = ex_disp_flush;            /*Used in buffered mode (LV_VDB_SIZE != 0  in lv_conf.h)*/

//    disp_drv.disp_fill = ex_disp_fill;              /*Used in unbuffered mode (LV_VDB_SIZE == 0  in lv_conf.h)*/
//    disp_drv.disp_map = ex_disp_map;                /*Used in unbuffered mode (LV_VDB_SIZE == 0  in lv_conf.h)*/
//    /*Finally register the driver*/
//    lv_disp_drv_register(&disp_drv);

//    /*************************
//     * Input device interface
//     *************************/
//    /*Add a touchpad in the example*/
//    /*touchpad_init();*/                            /*Initialize your touchpad*/
//    lv_indev_drv_t indev_drv;                       /*Descriptor of an input device driver*/
//    lv_indev_drv_init(&indev_drv);                  /*Basic initialization*/
//    indev_drv.type = LV_INDEV_TYPE_POINTER;         /*The touchpad is pointer type device*/
//    indev_drv.read = ex_tp_read;                    /*Library ready your touchpad via this function*/
//    lv_indev_drv_register(&indev_drv);              /*Finally register the driver*/
// }

